//
//  homeInformationCollectionViewCell.m
//  UI_A项目
//
//  Created by dlios on 15-1-15.
//  Copyright (c) 2015年 songCheng. All rights reserved.
//

#import "homeInformationCollectionViewCell.h"
#import "UIImageView+WebCache.h"
#import "SDImageCache.h"
@implementation homeInformationCollectionViewCell

- (void)dealloc
{
    [_homeLabel release];
    [_homeImageView release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView
{
    self.homeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 100, 100, 30)];
    //    self.homeLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.homeLabel];
    self.homeLabel.textAlignment = NSTextAlignmentCenter;
    [_homeLabel release];
    
    
    self.homeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 80)];
    //    self.homeImageView.backgroundColor = [UIColor redColor];
    self.homeImageView.layer.cornerRadius = 40;
    self.homeImageView.layer.borderWidth = 2;
    self.homeImageView.layer.borderColor = [UIColor colorWithRed:55/255.0 green:99/255.0 blue:100/255.0 alpha:1.0].CGColor;
    self.homeImageView.layer.masksToBounds = YES;
    [self.contentView addSubview:self.homeImageView];
    [_homeImageView release];
    
}

- (void)setModel:(HomeModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    self.homeLabel.text = model.tname;
    
    NSURL *url = [NSURL URLWithString:_model.cover_path];
    [self.homeImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"53074adebc306.jpg"]];
    
    
}


@end
